﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace MT.ControlLibrary.Controls
{
    public class ListBoxItemWithBtn: ListBoxItem
    {
        //按钮字体图标
        public static readonly DependencyProperty BtnIconProperty = DependencyProperty.Register("BtnIcon", typeof(object), typeof(ListBoxItemWithBtn), new PropertyMetadata(null));

        public object BtnIcon
        {
            get { return (object)GetValue(BtnIconProperty); }
            set { SetValue(BtnIconProperty, value); }
        }

        /// <summary>
        /// 按钮命令
        /// </summary>
        public static readonly DependencyProperty BtnCommandProperty = DependencyProperty.Register("BtnCommand", typeof(ICommand), typeof(ListBoxItemWithBtn), new PropertyMetadata(default(ICommand)));
        public ICommand BtnCommand
        {
            get { return (ICommand)GetValue(BtnCommandProperty); }
            set { SetValue(BtnCommandProperty, value); }
        }

        /// <summary>
        ///  按钮命令参数
        /// </summary>
        public static readonly DependencyProperty BtnCommandParameterProperty = DependencyProperty.Register("BtnCommandParameter", typeof(object), typeof(ListBoxItemWithBtn), new PropertyMetadata(default(object)));
        public object BtnCommandParameter
        {
            get { return (object)GetValue(BtnCommandParameterProperty); }
            set { SetValue(BtnCommandParameterProperty, value); }
        }

        static ListBoxItemWithBtn()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ListBoxItemWithBtn), new FrameworkPropertyMetadata(typeof(ListBoxItemWithBtn)));
        }
    }
}
